<?xml version="1.0" encoding="utf-8"?>
<process version="1" name="Failure" xmlns="http://www.nginn.org/WorkflowDefinition.1_0.xsd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<description>
		Test cases for failure.
			Case 1. Atomic task with fail handler
			Case 2. Composite task with fail handler (and raise error task)
			Case 3. Subprocess task with fail handler
			Case 4. Multi-instance task failure of single subtask
			Case 5. Two-level deep error handling
	</description>
    <dataTypes>
    </dataTypes>
    <variables>
		<variable name="v1" type="int" dir="In" required="true" />
    </variables>
    <body>
        <places>
            <place id="start" type="Start" />
            <place id="end" type="End" />
			<place id="p0" />
        </places>
        <tasks>
            <task id="T0" type="Empty" splitType="AND">
            </task>
			
			<task id="T1" type="ReceiveMessage">
				<parameters>
					<param variable="MessageCorrelationId"><expr>taskInstance.ProcessInstanceId + '.T1'</expr></param>
				</parameters>
            </task>
			
			<task id="T2" type="Timer" splitType="AND">
				<variables>
				</variables>
				<outputBindings>
				</outputBindings>
				<parameters>
					<param variable="DelayAmount"><expr>TimeSpan.FromMinutes(1)</expr></param>
				</parameters>
            </task>
			
            <task id="T3_F" label="After fail of T1" type="Empty" splitType="AND">
			</task>
			
			<composite id="T4" label="Composite">
				<body>
					<places>
                        <place id="T4_start" type="Start" />
                        <place id="T4_end" type="End" />
                    </places>
                    <tasks>
                        <task id="T4_T1" type="Timer">
                        	<parameters>
								<param variable="DelayAmount"><expr>TimeSpan.FromMinutes(1)</expr></param>
							</parameters>
						</task>
                    </tasks>
                    <flows>
                        <flow from="T4_start" to="T4_T1" />
                        <flow from="T4_T1" to="T4_end" />
                    </flows>
				</body>
			</composite>
			
			<composite id="T5" label="Composite">
				<body>
					<places>
                        <place id="T5_start" type="Start" />
                        <place id="T5_end" type="End" />
                    </places>
                    <tasks>
                        <task id="T5_T1" type="RaiseError">
						</task>
						<task id="T5_T2" type="ReceiveMessage">
							<parameters>
								<param variable="MessageCorrelationId"><expr>'T5_T2'</expr></param>
							</parameters>
						</task>
                    </tasks>
                    <flows>
                        <flow from="T5_start" to="T5_T1" />
						<flow from="T5_start" to="T5_T2" />
                        <flow from="T5_T1" to="T5_end" />
						<flow from="T5_T2" to="T5_end" />
                    </flows>
				</body>
			</composite>
        </tasks>
        <flows>
            <flow from="start" to="T0" />
            <flow from="T0" to="p0" />
			<flow from="p0" to="T1" />
			<flow from="T0" to="T2" />
            <flow from="T2" to="T4" />
			<flow from="T2" to="T5" />
			<flow from="T1" to="end" />
			<flow from="T1" taskOutPort="Error" to="T3_F" />
			<flow from="T3_F" to="end" />
			<flow from="T4" to="end" />
			<flow from="T5" to="end" />
        </flows>
    </body>
</process>